package com.softme.trade.util;

public class StringUtil
{
	/** Retorna a string com o primeiro caracter em maiusculo
	 * 
	 * @param value
	 * @return
	 */
	public static String toFirstCharacterUppercase(String value)
	{
		return value.substring(0,1).toUpperCase().concat(value.substring(1, value.length()));
	}
	
	public static String toFirstCharacterLowercase(String value)
	{
		return value.substring(0,1).toLowerCase().concat(value.substring(1, value.length()));
	}
	
	public static String getNameClass(String path)
	{
		String[] dir = path.split(".");
		
		return dir[dir.length - 1];
	}

	public static String getNameClass(String path, boolean toFirstCharacterLowercase)
	{
		String[] dir = path.split("\\.");
		String className = dir[dir.length - 1];
		
		if (toFirstCharacterLowercase)
			return toFirstCharacterLowercase(className);
		else
			return className;
	}
}
